﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Geeno.API.Model
{
    public sealed class Item
    {
        public int ID { get; set; } = 0;
        public double Price { get; set; } = 0;

        //注意 set 只有在进行赋值的时候，才会触发，对于dapper的映射处理，如果是NULL的对象的话，是不会进行set操作的
        private string _itemName="CM";

        public string ItemName
        {
            get
            {
               return _itemName;
            }
            set
            {
                _itemName = String.IsNullOrEmpty(value)? _itemName : value;
            }
        }
    }
    public  sealed class ItemTvp
    {
        public string ItemName { get; set; } = string.Empty;
        public decimal Price { get; set; } = 0;
    }
}
